﻿using System;
using System.Management.Automation;
using BGShell.Components;

namespace BGShell.PowerShell.Runspaces
{
    [Serializable]
    internal enum DataTipType
    {
        None = 0,
        Variable = 1,
        Command = 2,
        Type = 3,
    }

    [Serializable]
    internal struct DataTipInfo
    {
        private readonly String _text;
        private readonly TextRange _range;
        private readonly DataTipType _type;
        private readonly DataTipItem _item;

        public DataTipInfo(TextRange range, String text, DataTipType type)
        {
            _range = range;
            _text = text;
            _type = type;
            _item = null;
        }

        public DataTipInfo(DataTipInfo source, DataTipItem item)
        {
            _text = source._text;
            _range = source._range;
            _type = source._type;
            _item = item;
        }

        public TextRange Range
        {
            get { return _range; }
        }

        public String Text
        {
            get { return _text; }
        }

        public DataTipType Type
        {
            get { return _type; }
        }

        public DataTipItem Item
        {
            get { return _item; }
        }
    }
}
